import React from "react";
import {BrowserRouter, Switch, Route, Redirect, Link} from "react-router-dom"

import Home from './pages/Home'
import About from './pages/About'

export default function Root(props) {
  return (
    <BrowserRouter basename="/reactApp">
      <div>{props.name}</div>
      <div>
        <Link to="home">Home</Link>
        <Link to="about">About</Link>
      </div>
      <Switch>
        <Route path="/home">
          <Home></Home>
        </Route>
        <Route path="/about">
          <About></About>
        </Route>
        <Route path="/">
          <Redirect to="/home" />
        </Route>
        
      </Switch>
    </BrowserRouter>
  );
}
